package cn.ly817.jay.entity;

import cn.ly817.jay.enums.MissionGrade;

import java.util.Date;

/**
 * Created by LuoYu on 2016/12/2.
 */
public class Mission {

    private long id;

    private long projectId;

    private long groupId;

    private long originatorId;

    private long processorId;

    private String detail;

    private int state;

    //A-1-4,B-2-8,C-3-16
    private int missionGrade;

    private String GRADE;

    private String added;

    private Date generateDate;

    //非数据库字段

    private User originator;

    private User processor;

    private Project project;

    private int score;

    @Override
    public String toString() {
        return "Mission{" +
                "id=" + id +
                ", projectId=" + projectId +
                ", groupId=" + groupId +
                ", originatorId=" + originatorId +
                ", processorId=" + processorId +
                ", detail='" + detail + '\'' +
                ", state=" + state +
                ", missionGrade=" + missionGrade +
                ", GRADE='" + GRADE + '\'' +
                ", added='" + added + '\'' +
                ", generateDate=" + generateDate +
                ", originator=" + originator +
                ", processor=" + processor +
                ", project=" + project +
                ", score=" + score +
                '}';
    }

    public int getMissionGrade() {
        return missionGrade;
    }
    //TODO 构造方法的get set
    public void setMissionGrade(int missionGrade) {
        this.score = MissionGrade.scoreOf(missionGrade);
        this.GRADE = MissionGrade.stateOf(missionGrade).toString();
        this.missionGrade = missionGrade;
    }

    public User getProcessor() {
        return processor;
    }

    public void setProcessor(User processor) {
        this.processor = processor;
    }

    public User getOriginator() {

        return originator;
    }

    public void setOriginator(User originator) {
        this.originator = originator;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getProjectId() {
        return projectId;
    }

    public void setProjectId(long projectId) {
        this.projectId = projectId;
    }

    public long getGroupId() {
        return groupId;
    }

    public void setGroupId(long groupId) {
        this.groupId = groupId;
    }

    public long getOriginatorId() {
        return originatorId;
    }

    public void setOriginatorId(long originatorId) {
        this.originatorId = originatorId;
    }

    public long getProcessorId() {
        return processorId;
    }

    public void setProcessorId(long processorId) {
        this.processorId = processorId;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getAdded() {
        return added;
    }

    public void setAdded(String added) {
        this.added = added;
    }

    public Date getGenerateDate() {
        return generateDate;
    }

    public void setGenerateDate(Date generateDate) {
        this.generateDate = generateDate;
    }

    public Project getProject() {
        return project;
    }

    public void setProject(Project project) {
        this.project = project;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getGRADE() {
        return GRADE;
    }

    public void setGRADE(String GRADE) {
        this.GRADE = GRADE;
    }
}
